//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteTag {
        private readonly ITagRepository _TagRepository;

        public DeleteTag(ITagRepository TagRepository) {
            _TagRepository = TagRepository;
        }

        public virtual void Execute(Guid tagId) {
            var TagToDelete = _TagRepository.GetTag(tagId);

            if (TagToDelete != null) {
                _TagRepository.Delete(tagId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
